<?php

namespace App\Http\Controllers;

use App\Library\Requests\Base\SerialNumberRequest;
use App\Library\Requests\Pet\PetAddBatchRequest;
use App\Library\Requests\Pet\PetAddRequest;
use App\Library\Requests\Pet\PetEditRequest;
use App\Library\Requests\Pet\PetPageRequest;
use App\Library\Service\PetService;
use Illuminate\Http\JsonResponse;

class PetController extends BaseController
{
    /**
     * @param PetService $service
     */
    public function __construct(PetService $service)
    {
        $this->service = $service;
    }

    /**
     * 分页
     * @param PetPageRequest $request
     * @return JsonResponse
     */
    public function paging(PetPageRequest $request): JsonResponse
    {
        return $this->service->paging($request);
    }

    /**
     * detail
     * @param SerialNumberRequest $request
     * @return JsonResponse
     */
    public function detail(SerialNumberRequest $request): JsonResponse
    {
        return $this->service->detail($request);
    }

    /**
     * 删除
     * @param SerialNumberRequest $request
     * @return JsonResponse
     */
    public function delete(SerialNumberRequest $request): JsonResponse
    {
        return $this->service->delete($request);
    }

    /**
     * add
     * @param PetAddRequest $request
     * @return JsonResponse
     */
    public function add(PetAddRequest $request): JsonResponse
    {
        return $this->service->add($request);
    }

    /**
     * edit
     * @param PetEditRequest $request
     * @return JsonResponse
     */
    public function edit(PetEditRequest $request): JsonResponse
    {
        return $this->service->edit($request);
    }

    /**
     * addBatch
     * @param PetAddBatchRequest $request
     * @return JsonResponse
     */
    public function addBatch(PetAddBatchRequest $request): JsonResponse
    {
        return $this->service->addBatch($request);
    }
}
